package byx.container.annotation.CustomInjectTest.a;

import byx.container.annotation.extension.impl.CustomInjector;
import byx.container.annotation.annotation.Inject;
import byx.container.annotation.annotation.Register;
import byx.container.core.Container;
import byx.container.core.ObjectFactories;
import byx.container.core.ObjectFactory;

@Register
public class B {
    private final String data;

    public B(@Inject(MyInjector1.class) String data) {
        this.data = data;
    }

    public String getData() {
        return data;
    }
}

class MyInjector1 implements CustomInjector {
    @Override
    public ObjectFactory<?> getObjectFactory(Container container) {
        return ObjectFactories.fromContainer(container, A.class).call(A::msg);
    }
}
